<div style="width: 1000px;margin: 0px auto;min-height: 700px;">
    <div class="index-head">
        <div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel" style="overflow: hidden;">
            <ol class="carousel-indicators">
                <li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
                <li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
                <li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
            </ol>
            <div class="carousel-inner" style="height: 500px;">
                <div class="carousel-item active">
                    <img class="d-block w-100" src="/study/public/imga/lb1.jpg" alt="First slide">
                </div>
                <div class="carousel-item">
                    <img class="d-block w-100" src="/study/public/imga/lb2.jpg" alt="Second slide">
                </div>
                <div class="carousel-item">
                    <img class="d-block w-100" src="/study/public/imga/lb3.jpg" alt="Third slide">
                </div>
            </div>
            <a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
                <span class="carousel-control-prev-icon" aria-hidden="true"></span>
                <span class="sr-only">Previous</span>
            </a>
            <a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
                <span class="carousel-control-next-icon" aria-hidden="true"></span>
                <span class="sr-only">Next</span>
            </a>
        </div>
    </div>
    <div class="index-both" style="margin-top: 20px;margin-bottom: 20px;">
        <h4 class="h4" style="margin-bottom: 20px;">试题列表</h4>
        <table class="table table-bordered">
            <tr class="success ">
                <th width="5%">ID</th>
                <th width="10%">科目名称</th>
                <th width="5%">学分</th>
                <th width="40%">介绍</th>
                <th width="5%">操作</th>
            </tr>
            <?php
                foreach ($rows as $value) {
            ?>
            <tr>
                <td><?=$value['id']?></td>
                <td><?=$value['cname']?></td>
                <td><?=$value['credit']?></td>
                <td><?=$value['info']?></td>
                <td><a class="btn btn-primary examination" id="examination" sid="<?=$value['id']?>">
                        <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>&nbsp;参加考试</a>
            </tr>
            <?php }?>
        </table>
    </div>
</div>
<script>
    $('.examination').on('click', function (e) {
        e.preventDefault();
        layer.alert(e, {
            title: ' 提示：',
            content: " <h2>是否参与考试？</h2>",
            area: '500px',
            btn: ['确定', '取消'],
            yes: function () {
                location.href = "examination.php?id="+$(e.target).attr('sid');
            }
        });
    })
</script>